<!DOCTYPE html>
<html lang="zh-CN">
<head>
<title>个人信息</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="format-detection" content="telephone=no"/>
<meta name="format-detection" content="email=no"/>
<meta name="format-detection" content="address=no"/>
<link href="__PUBLIC__/css/base.css" rel="stylesheet"/>
</head>
<body class="huibg">
<!---  头部开始  -->
<div class="top clearfix">
	<div class="icon_left"></div>
	<div class="icon_right"></div>
</div>
<!---  头部结束  -->
<div class="person_info person_info4 cssss">
	<table class="tab_05">
		<tr>
			<th>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</th>
			<td><input name="name" type="text" value="{$userinfo.name}"></td>
			<td></td>
		</tr>
		<tr>
			<th>工作单位：</th>
			<td><input name="hospital" type="text" value="{$userinfo.hospital}"></td>
			<td></td>
		</tr>
		<tr>
			<th>工作科室：</th>
			<td>
				<!--
				<select name="department">
					<volist name="department" id="vo">
					<option value="{$vo.name}" <if condition="$vo.name eq $userinfo.department">selected="selected"</if>>{$vo.name}</option>
					</volist>
				</select>
				-->
				<input class="department" type="text" name="department" placeholder="请选择科室" value="{$userinfo.department}">
			</td>
			<td><i class="jiantou4"></i></td>
		</tr>
		<tr>
			<th>职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称：</th>
			<td><input name="position" type="text" value="{$userinfo.position}" readonly="readonly"></td>
			<td></td>
		</tr>
		<tr>
			<th>社会职务：</th>
			<td><input name="socialposition" type="text" value="{$userinfo.socialposition}"></td>
			<td></td>
		</tr>
		<tr>
			<th>手 机 号：</th>
			<td><input name="mobile" type="text" value="{$userinfo.mobile}"></td>
			<td></td>
		</tr>
		<tr>
			<th>邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;箱：</th>
			<td><input name="email" type="text" value="{$userinfo.email}"></td>
			<td></td>
		</tr>	
	</table>
	<div class="box_08">
		<div class="title">简历<!--<i></i>--></div>
		<p class="resume"><textarea name="resume" rows="10" cols="30" placeholder="请填写简历">{$userinfo.resume}</textarea></p>
	</div>
	<div class="bott2">
		<a class="yes tijiao">保存个人信息</a>
	</div>
</div>
<!---  统一样式浮层开始  -->
<div class="fc_box none">
	<div class="fcBox_bg"></div>
	<div class="fcBox_text">
		<dl>
			<dt>选择工作科室：<span class="close3"></span></dt>
			<volist name="department" id="vo">
				<dd>{$vo.name}</dd>
			</volist>
		</dl>
	</div>
</div>
<!---  统一样式浮层结束  -->
<!---  填写框开始  -->
<div class="text_Box none">
	<div class="textBox_bg"></div>
	<div class="textBox_text">
		<i class="close4"></i>
		<textarea class="tianxie_box" name="" id="" cols="30" rows="10" placeholder="请输入..."></textarea>
		<a class="confirm"><span>确定</span></a>
	</div>
</div>
<!---  填写框结束  -->
</body>
<script src="__PUBLIC__/js/jquery.js"></script>
<script src="__PUBLIC__/js/comm.js"></script>
<script>
var name1;
var hospital1;
var department1;
var position1;
var socialposition1;
var mobile1;
var email1;
var resume1;
//选择科室
$(".department,.jiantou4").click(function(){
	$(".fc_box").removeClass("none");
});
$(".fc_box dd").click(function(){
	$(".department").val($(this).html());
	$(".fc_box").addClass("none");
});
//点击简历填写框
$(".resume").click(function(){
	$(".text_Box").removeClass("none");
});
//点击填写框确定按钮
$(".confirm").click(function(){
	$(".resume textarea").val($(".tianxie_box").val());
	$(this).parents(".text_Box").addClass("none");
});
function check(){
	name1=$.trim($(".person_info input[name='name']").val());
	hospital1=$.trim($(".person_info input[name='hospital']").val());
	department1=$.trim($(".person_info input[name='department']").val());
	position1=$.trim($(".person_info input[name='position']").val());
	socialposition1=$.trim($(".person_info input[name='socialposition']").val());
	mobile1=$.trim($(".person_info input[name='mobile']").val());
	email1=$.trim($(".person_info input[name='email']").val());
	resume1=$.trim($(".person_info textarea[name='resume']").val());
	
	if((name1.length<1) || (name1.length>5)){
		alert("请正确输入用户名");
		return false;
	}
	var myReg = /^[\u4e00-\u9fa5]+$/;
	if(hospital1.length<1 || !myReg.test(hospital1)){
		alert("请正确输入工作科室");
		return false;
	}
	if (position1.length<1) {
		position1="无";
	}
	if (socialposition1.length<1) {
		socialposition1="无";
	}
	if(department1.length<1){
		alert("请选择科室");
		return false;
	}
	var isMobile=/^(?:13\d|15\d|18\d)\d{5}(\d{3}|\*{3})$/;
	if((mobile1.length<1) || !isMobile.test(mobile1)){
		alert("请正确输入手机号码");
		return false;
	}
	var reg = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
	if(email1.length<1 || !reg.test(email1)){
		alert("请正确输入邮箱");
		return false;
	}
}
//保存个人信息
$(".tijiao").click(function(){
	if(check()==false){

	}else{
		$.post("__URL__/person_info4_edit",{
			name:name1,
			hospital:hospital1,
			department:department1,
			position:position1,
			socialposition:socialposition1,
			mobile:mobile1,
			email:email1,
			resume:resume1,
		},function(e){		 
			if(e.status==1){
				alert("保存成功");
				window.location="__URL__/person_info4_edit";
			}else{
				alert(e.msg);
			}
		});
	}
});
</script>
</html>